<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style type="text/css">
        body{
        padding: 0px;
        margin: 0px;
        }
        .content {
            width: 960px;
            margin: 0px auto;
        }
        /* 导航DIV使用弹性布局 */
        .daohang {
            display: flex;
            flex-direction: row;
            width: 100%;
            background-color: aqua;
        }

        .items {
            width: 130px;
            color: #fff;
        }

        /* 菜单设置相对定位，高度45像素
        设置隐藏溢出 */
        .menu{
            width: 100%;
            height: 45px;
            background: red;
            line-height: 45px;
            text-align: center;
            position: relative;
            overflow: hidden;            
        }
        /* 鼠标移入去除隐藏溢出
        把子导航显示出来 */
        .menu:hover{
            overflow: visible;
            background: black;
            color: white;
            z-index: 999;
            cursor: pointer;
            
        }

        /* 下拉子菜单样式 */
        .drop{
            background: red;
            text-align: center;
            width: 100%;
            height: 45px;
            line-height: 45px;
            overflow: hidden;
        }
        .drop:hover{
            background: black;
            cursor: pointer;
        }

        .webbody{
            height: 2000px;
            width: 100%;
            background-color: bisque;
        }
    </style>
</head>
<body>
    <!-- 首先，把html结构写好 -->
    <div class="content">
        <div class="daohang">
            <!-- 有菜单 -->
            <div class="items">
                <div class="menu">
                    <span>后端学习</span>
                    <div>
                        <div class="drop">JAVA</div>
                        <div class="drop">Go</div>
                        <div class="drop">PHP</div>
                    </div>
                </div>
            </div>
            <!-- 无下级 -->
            <div class="items">
                <div class="menu">
                    <span>前端学习</span>
                    <div></div>
                </div>
            </div>
        </div>
        <div class="webbody">
            网站内容
        </div>
    </div>
</body>
</html>